package com.showsu.editor.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author edison
 */

@Getter
@AllArgsConstructor
public enum ModerationStatusEnum {

    Enable(0, "正常"),
    Disable(1, "禁用"),
    Review(2, "待审核"),
    TextReview(3, "文本待审核"),
    ManualReview(4, "待人工审核"),
    ;

    /**
     * 状态码
     */
    final int code;

    /**
     * 描述
     */
    final String msg;

    public static ModerationStatusEnum getByCode(Integer code) {
        if(code==null){
            return ModerationStatusEnum.Review;
        }
        for(ModerationStatusEnum serviceCodeEnum : ModerationStatusEnum.values()) {
            if (serviceCodeEnum.getCode()==code){
                return serviceCodeEnum;
            }
        }
        return ModerationStatusEnum.Review;
    }
}
